package com.itheima.service.impl;

import com.itheima.dao.EmpDao;
import com.itheima.domain.Emp;
import com.itheima.service.EmpService;
import com.itheima.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

public class EmpServiceImpl implements EmpService {

    @Override
    public void add(Emp emp) {
        SqlSession sqlSession=MybatisUtils.getSqlSession();
        EmpDao empDao = sqlSession.getMapper(EmpDao.class);
        empDao.add(emp);
        sqlSession.close();
    }
}
